
<include file="./Tpl/IT123org/Common/member_header.html" />

<script src="__ROOT__/Data/Common/Js/tagsinput/jquery.tagsinput.js"></script>
<link rel="stylesheet" type="text/css" href="__ROOT__/Data/Common/Js/tagsinput/jquery.tagsinput.css" />	





<style type="text/css">

        #imgdiv{
                width: 100px;
                overflow: hidden;
                position: relative;
        }
        #imgShow
        {

        }
        /*input区域的样式*/
        #up_img
        {
                /*display: none;*/
                /*                height: 0px;
                width: 0px;*/
                width: 100px;
                height: 100px;


                position: absolute;
                top: 0px;
                right: -10px;
                z-index: 9999;
                display: block;
                cursor: pointer;
                font-size: 100px;
                opacity: 0;
                -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
                filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);



        }
</style>


</head>
<body>
        <!--导航-->
<include file="./Tpl/IT123org/Common/member_menu.html" />
<!--导航-->

<div class="container">
        <div class="row">

                <div class="col-md-12">


                        <h3>添加文章</h3>



                        <form action="__APP__/Member/editArticleDo/" method="post"  class="mar_t15">








                                <div class="form-group">

                                        <input type="text" name="title" id="title" class="form-control" placeholder="标题(30字内)">
                                </div>

                                <div class="form-group">

                                        <input  name="tags" id="tags"  class="form-control">

                                </div>




                                <div class="form-group">



                                        <textarea  name='description'  cols="10"     class="form-control" rows="3" placeholder="描述(100字内)" ></textarea>




                                </div>

                                <div class="form-group">
                                        <label for="title">点击缩略图区域</label>


                                        <div id="imgdiv">



                                                <img id="imgShow" width="100" height="100" />



                                                <input type="file" id="up_img"  data-url="" class="js_videoUpload"  name="file" multiple enctype="multipart/form-data"/>

                                        </div>

                                        <a  onclick="a()"></a>


                                </div>



          

                                <div class="form-group">
                                        <label for="content">文章内容</label>
                                        <textarea  id="editor"></textarea>


                                </div>


                                <input name="article_aid" value="{$article_aid}" type="hidden"/>	


                                <div class="checkbox">

                                        <button type="submit" class="btn btn-default pull-right btn-lg">发布</button>
                                </div>
                        </form>

                </div>
        </div>
</div>

<!--footer-->
<include file="./Tpl/IT123org/Common/member_footer.html" />

<script type="text/javascript" src="__ROOT__/Data/Common/Js/uploadPreview/uploadPreview.js"></script>

<script type="text/javascript" src="__ROOT__/Data/Common/Js/jquery.ajaxfileupload.js"></script>

<SCRIPT  charset="utf-8" src="__ROOT__/Data/Common/Js/Ueditor/ueditor.config.js"></SCRIPT>
<SCRIPT  charset="utf-8" src="__ROOT__/Data/Common/Js/Ueditor/ueditor.all.js"></SCRIPT>

<script>


                                                $('#tags').tagsInput();

                                                window.UEDITOR_HOME_URL = '__ROOT__/Data/Common/Js/Public/Ueditor/';

                                                window.onload = function() {
                                                        window.UEDITOR_CONFIG.initialFrameHeight = 300;
                                                        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;

                                                        UE.Editor.prototype.getActionUrl = function(action) {
                                                                if (action == 'uploadimage') {
                                                                        return '__URL__/upArticlePic/id/{$article_aid}';
                                                                }
                                                                return this._bkGetActionUrl(action);
                                                        }

                                                        UE.getEditor('editor', {
                                                                toolbars: [['source',
                                                                                'paragraph', //段落格式                         'fontsize',
                                                                                "bold", 'italic', 'underline', "forecolor", 'bold', 'simpleupload', //单图上传
                                                                                'justifyleft', 'justifycenter', 'justifyright', 'insertcode']
                                                                ]
                                                        });
                                                }

</script>






<script type="text/javascript">

        function a()
        {
                $("#up_img").click();
        }


        $(document).ready(function()
        {
                var interval;

                function applyAjaxFileUpload(element)
                {
                        $(element).AjaxFileUpload(
                                {
                                        action: "__URL__/upArtThumb/id/{$article_aid}",
                                        onChange: function(filename)
                                        {


                                        },
                                        onSubmit: function(filename)
                                        {


                                                // Return key-value pair to be sent along with the file
                                                return true;
                                        },
                                        onComplete: function(filename, response)
                                        {

                                                $("#imgShow").attr("src", response.url);
                                                console.log(response.url);
                                        }
                                });
                }

                applyAjaxFileUpload(".js_videoUpload");
        });



</script>







</body>
</html>